<?php

class JobsController extends AppController {

//	var $name = '';

	function today() {
		$this->layout = 'ajax';
		$jobs = $this->Job->getTodaysJobs();
		$loadedModels = array();
		$this->set('jobs', $jobs);
		$r = array();
		foreach($jobs as $job) {
			if (!in_array($job['Job']['actor'], $loadedModels)) {
				App::import('Model', $job['Job']['actor']);
				$loadedModels[] = $job['Job']['actor'];
			}
			$model = new $job['Job']['actor']();
			$r[] = $model->$job['Job']['method']($job);
		}
		$this->set('returned', $r);
	}

}

?>